package com.ssm.controller;

import com.ssm.bean.Department;
import com.ssm.bean.Msg;
import com.ssm.service.interfaces.IDepartmentSV;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Copyright: Copyright (c) 2018/1/24
 * Description: 处理与department相关的请求
 * CLASS_NAME: DepartmentController
 * PACKAGE_NAME: com.ssm.controller
 * version: v1.0.0
 * author: Jin Biao
 * date: 2018/1/24 11:04
 */
@Controller
public class DepartmentController {

    @Autowired
    private IDepartmentSV departmentSV;

    @RequestMapping("/getAllDepts")
    @ResponseBody
    public Msg getAllDepats() throws Exception{
        List<Department> deptList = departmentSV.getAllDepts();
        return Msg.success().add("deptInfo",deptList);
    }
}
